home *** CD-ROM | disk | FTP | other *** search
/ Guide To Cracking 2002 / Guide_to_Cracking_2002.iso / Tutorials / Nag and Time Trial / nag / ns33.txt < prev    next >
Encoding:
Text File  |  2000-02-29  |  5.9 KB  |  182 lines

  1.  
  2.                  Cracking for Newbies #2 - by woody^drn
  3.  
  4. Lets talk about how to approach a program with different kind of
  5. protections.
  6.  
  7.  
  8. How to defeat nags:
  9. -------------------
  10.  
  11. There are several ways to defeat nag screens, and several different
  12. kinda nags.
  13.  
  14. **Window with a button:
  15.  
  16. Try to break on messageboxa. If it breaks, press F12 .. now the nag will
  17. appear press the ok button or what ever button there is, and sice will
  18. break again. Check if you're in the right file .. if not press F12 until
  19. you are.
  20.  
  21. When you're in the right file, there should be a call right over the
  22. line you're at now. Scroll back .. do you see a je/jne ? yer ? reverse
  23. it or jump it. Didn't see a je/jne .. Press F12 .. scroll back, now
  24. do you see it ? if not do this until you do, and patch the je/jne.
  25. Does it work now ? if not .. read on.
  26.  
  27. If messageboxa didn't work try getdlgitemtexta or getwindowtexta,
  28. and do the same thing.
  29.  
  30. **Window without a button (works with both!):
  31.  
  32. None of them worked! Okay, then we try another approach. Run the program
  33. and wait until the nag appears. It's there ? good .. break into sice and
  34. type hnwd, and you should see the windows handles, something like this:
  35.  
  36. 0080(0)      2057  32  MSGSRV32   #32769 (desktop)  179F:00005622
  37.  05D0(1)     52AF  32  IEXPLORE   Auto-Suggest Drop 140F:00000FC6
  38.  
  39. and so on ... press enter until you see your program. If your program
  40. was calc.exe it would look something like this:
  41.  
  42.  0314(1)     3D27  32  CALC       SciCalc           484F:00000786
  43.  
  44. The 0314 is the window handle, and that's what we're gonna break on.
  45. A window/window call does some checks, it checks when the mouse moves,
  46. and if the window is on focus and many other things. But what we need
  47. to know is what the command is when the window closes. and that's
  48. WM_DESTROY. Okay .. to break on the window handle we use the command
  49. bmsg (breakpoint on window message) type 'bmsg 0314 WM_DESTROY', if you
  50. just typed 'bmsg 0314' it will break every time you move the mouse on
  51. the window, and every time it's on focus .. and all the other commands/
  52. checks it does. But with wm_destroy it only breaks when it's going to
  53. close the window. Now press F12 until you're at the right file, and
  54. scroll back to check for je/jne's ..
  55.  
  56. **Splash Screens:
  57.  
  58. This kinda nag could window without any buttons, just some naggy texts.
  59. The first thing you do is to write the top and caption text down.
  60. Could look like this:
  61.  
  62. +-------------------+
  63. |▓Please▒Register▒!░|
  64. +-------------------+
  65. | Register this nag |
  66. |    only $200      |
  67. +-------------------+
  68.  
  69. Now open your favorite hex editor and search for the text, found it ?
  70. Scroll back and find these bytes FF FF FF 80 ... replace 80 with 90, and
  71. the nag should go away :) if not debug it.
  72.  
  73.  
  74. How to defeat removed features:
  75. -------------------------------
  76.  
  77. Programmers are usually lazy ;) me included ;) .. they often make
  78. a function that say "This feature is for registered only!" or something
  79. like that. So many times we only have to patch one place.
  80.  
  81. **With w32dasm:
  82.  
  83. It's quicker to use w32dasm first if you're an newbie, so boot up
  84. w32dasm and start searching for the text. If you found it, scroll back
  85. and look for je/jne's. Many times the protection is easy like:
  86.  
  87. call <address>
  88. test eax,eax
  89. je   <address>
  90.  
  91. It calls the registration engine, and returns eax 1 or 0.
  92. Then it texts eax to see if it's 0, if not say "This feature ..."
  93.  
  94. Now you could step into the call and make it return 0 in eax no matter
  95. what, or you could just reverse the je to jne or nop it.
  96.  
  97. In Pascal this would be:
  98.  
  99. begin
  100.   check_if_registered;
  101.   if registered=true then do_feature else display_nag;
  102. end.
  103.  
  104. This kinda protection is normal! and is *very* easy to crack.
  105.  
  106. **With sice:
  107.  
  108. But you could also use sice for this, just make it break on the window
  109. commands (getwindowtexta, messageboxa, getdlgitemtexta and so on), and
  110. when it breaks press F11 to get the caller and check for je/jne's.
  111.  
  112.  
  113. How to defeat serials:
  114. ----------------------
  115.  
  116. This is kinda hard to write about, cause the variation between methods
  117. how to make serials is very big. But there *is* some erhm "same" ways
  118. that the bad serial is compared to the right one.
  119.  
  120. **Memory echo:
  121.  
  122. Be suspicious when you see this kinda code:
  123.  
  124. mov bl,[esi]
  125. mov bh,[edi]
  126. cmp bl,bh
  127. jne ...
  128.  
  129. First it moves one byte from the good serial to esi, then it moves
  130. on byte from the "bad" (?) serial to edi, and compares those two.
  131. If they aren't the same the serial is wrong.
  132.  
  133. So what you got to do is type 'd esi' and the correct serial should be
  134. there. Another code that does the same thing:
  135.  
  136. mov ecx,length_of_valid_serial
  137. repz cmpsw
  138. je ...
  139.  
  140. Moves ecx to how many bytes to compare, compares string at ds:esi (the
  141. correct serial) with es:edi (our serial). Just type 'd esi' and the
  142. correct serial should be there.
  143.  
  144. Another code that moves serials:
  145.  
  146. push ecx
  147. shr ecx,2
  148. repz movsd
  149. pop ecx
  150. and ecx,3
  151. repz movsv
  152. xor dx
  153. xor ax
  154.  
  155. Here it saves ecx, find the number of words to copy, and copies them to
  156. es:di. Gets ecx again and copies it to es:di.
  157.  
  158. When you're done with repz movsd type 'd ds:si' you should see the
  159. serial and name or whatever you typed. Now type 'd es:edi' and it will
  160. show you the location where your information will be copied to ..
  161. ie 1243:00000000. Now type 'page 1243:00000000' and something like this
  162. will show up.
  163.  
  164. 04D23000   C73B3000    P A U RW   System
  165.  
  166. Now you need to know how many bytes the serial is, or you can guess!
  167. Look in the help file in the program, maybe he says something about it.
  168.  
  169. type 'bpr 30:04d23000 30:04d2300A RW'
  170.  
  171. This is for 10 bytes pwd, 04d23000+10 (10 = 0Ah) = 04d2300A.
  172. All ways use the selector 30, that's just the way it is !
  173.  
  174. Now F5 and make sice break again .. and F5 .. and sice will break when
  175. it reads the serial. smart huh ?
  176.  
  177. Guess that's it for today ... wanna say thnx to +orc and josephco for
  178. some of this info.
  179.  
  180. -wOODY^dRN
  181.  
  182.